package com.chaofan.service.impl;

import com.chaofan.dao.BookMapper;
import com.chaofan.entity.Books;
import com.chaofan.service.BookService;
import lombok.Setter;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 书业务实现类
 * @author Fairy
 */
public class BookServiceImpl implements BookService {

    @Setter
    private BookMapper bookMapper;

    @Override
    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    @Override
    public int deleteBook(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }
}
